<template>
    <div class="dialog">
        <el-dialog
            title="编辑应用信息"
            :visible.sync="ifShowDialog"
        >
            <el-form
                :model="appInfo"
                style="width: 100%"
                label-width="150px"
            >
                <el-form-item
                    label="应用名称"
                >
                    <el-input v-model="appInfo.appName"></el-input>
                </el-form-item>

                <el-form-item
                    label="主题颜色"
                >
                    <el-color-picker  v-model="appInfo.subjectColor"  style="float: left"></el-color-picker>
                </el-form-item>

                <el-form-item
                    label="应用模式"
                >
                    <el-select
                        style="float:left"
                        v-model="appInfo.appModel"
                    >
                        <el-option
                            v-for="(item, index) in allModel"
                            :key="index"
                            :label="item.label"
                            :value="item.value"
                        ></el-option>
                    </el-select>
                </el-form-item>

                <el-form-item
                    label="手续费"
                >
                    <el-input-number style="float: left" v-model="appInfo.chargeFee" :min="0" :max="100" ></el-input-number>
                    <span style="float:left;margin-left: 20px">百分比</span>
                </el-form-item>

                <el-form-item
                    label="微信appid"
                >
                    <el-input v-model="appInfo.appId"></el-input>
                </el-form-item>

                <el-form-item
                    label="微信secret"
                >
                    <el-input v-model="appInfo.appSecret"></el-input>
                </el-form-item>

                <el-form-item
                    label="七牛云accessKey"
                >
                    <el-input v-model="appInfo.qiniuAccessKey"></el-input>
                </el-form-item>

                <el-form-item
                    label="七牛云secret"
                >
                    <el-input v-model="appInfo.qiniuSecretKey"></el-input>
                </el-form-item>

                <el-form-item
                    label="七牛云bucket"
                >
                    <el-input v-model="appInfo.qiniuBucket"></el-input>
                </el-form-item>

                <el-form-item
                    label="七牛云域名"
                >
                    <el-input v-model="appInfo.qiniuDomain"></el-input>
                </el-form-item>

                <el-form-item
                    label="提问规则描述"
                >
                    <el-input type="textarea" v-model="appInfo.askRule" :autosize="true"></el-input>
                </el-form-item>

                <el-form-item>
                    <el-button type="primary" style="margin-right: 50px" @click="confirmChange">修改</el-button>
                    <el-button type="info" @click="cancelChange">取消</el-button>
                </el-form-item>
                

            </el-form>
        </el-dialog>
    </div>
</template>

<script>
export default {
    name: 'Dialog',
    props: {
        appInfo: Object
    },
    data () {
        return {
            ifShowDialog: false,
            allModel: [
                {
                    label: '开放式',
                    value: 'society'
                },
                {
                    label: '门店式',
                    value: 'store'
                }
            ]
        }
    },
    mounted() {
        
    },
    methods: {
        show () {
            this.ifShowDialog = true;
        },
        confirmChange () {
            this.$emit('confirmChange');
            this.ifShowDialog = false;
        },
        cancelChange () {
            this.ifShowDialog = false;
        }
    }
}
</script>

<style lang="stylus" scoped>
    .dialog 
        width 100%
</style>


